package com.helpustotravel.servlet;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.helpustotravel.core.ServletBase;
import com.helpustotravel.model.dao.PhotoDAO;

@SuppressWarnings("serial")
public class SetProfilPhotoServlet extends ServletBase {

	public static String NAME = "SetProfilPhoto";
	
	protected HttpServletResponse doTache(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		String travellerName = req.getParameter("travellerName");
		String blobkey = req.getParameter("blobkey");

		PhotoDAO photoDao = new PhotoDAO(pm);
		photoDao.setProfilPhoto(travellerName, blobkey);
		
		resp.getWriter().println("ok");
		
		return resp;
	}
}
